<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div><table>
    <tr>
        <th>id</th>
        <th>标题</th>
        <th>关键词</th>
        <th>描述</th>
        <th>域名</th>
        <th>编辑</th>
    </tr>
    <c:forEach items="${page.list}" var="site">
        <tr>
            <td>${site.id}</td>
            <td>${site.title}</td>
            <td>${site.keywords}</td>
            <td>${site.description}</td>
            <td>${site.domain}</td>
            <td>编辑|删除</td>
        </tr>
    </c:forEach>
</table>
    <div class ="pager">
        <table class="gridtable" style="width:100%;text-align: center;">
            <tr>
                <%--上一页 hasPreviousPage布尔值是否有上一页，prePage上一页页面--%>
                <c:if test="${page.hasPreviousPage}">
                    <td><a href="${pageContext.request.contextPath}/site?pageNum=${page.prePage}&pageSize=${page.pageSize}">前一页</a></td>
                </c:if>
                 <%--navigatepageNums 集合所有页码  --%>
                <c:forEach items="${page.navigatepageNums}" var="nav">
                    <c:if test="${nav == page.pageNum}">
                        <td style="font-weight: bold;">${nav}</td>
                    </c:if>
                    <c:if test="${nav != page.pageNum}">
                        <td><a href="${pageContext.request.contextPath}/site?pageNum=${nav}&pageSize=${page.pageSize}">${nav}</a></td>
                    </c:if>
                </c:forEach>
                    <%--hasNextPage 布尔值判断是否有下一页 nextPage下一页的页码--%>
                <c:if test="${page.hasNextPage}">
                    <td><a href="${pageContext.request.contextPath}/site?pageNum=${page.nextPage}&pageSize=${page.pageSize}">下一页</a></td>
                </c:if>
            </tr>
        </table>


    </div>
</div>


</body>
</html>
